<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>enjoy模板引擎</title>
</head>
<body>
#include("nav.html", title="头部导航" )

#set(i=123)
#(i)
<br>
#(1+1)
<br>
#(1.111110)
<br>
#("我是一个String")
<br>
#(1+1, 1==1) <!--输出的是最后一个运算-->
<br>
#(1+1, 1==1, null)

<br>
#number(3.14159, "#.##")
<br>
#number(3.14159, "#.##%")
<br>
#number(300000, "光速每秒, ###公里.")
<br>
#(username)
<br>
#if(username == "kiaxxx")
#(username) 是傻逼
#else if(username == "kia")
#(username) 是天才
<br>
#else
#(username) 什么也不是
#end
#for( i: [1 .. 3])
#(i) <br>
#end
<br>
#for( i: [3 .. 1])
#(i) <br>
#end
<br>
#define test()
#("自定义函数")
#end
<br>


#set(map ={k1: 123, k2: "abc" , "k3": user})
#(map.k1)<br>
#(map["k1"])<br>
#(map.get("k1"))<br>
#(map.k2)<br>
#(map["k2"])<br>


<form enctype="multipart/form-data" name="upload" action="/upload" method="post">
    上传 <input type="file" name="uploadFile">
    <br>
    <h4 style="color: red;: red">#(msg)</h4>
    <br>
    <input type="submit" value="submit">
</form>
<form enctype="multipart/form-data" name="upload1" action="/servletUpload" method="post">
    上传 <input type="file" name="uploadFile">
    <br>
    <h4 style="color: red;: red">#(msg)</h4>
    <br>
    <input type="submit" value="submit">
</form>

<input type="text" name="username" value='#(username)'>

<h3>后端传过来的user对象</h3>
<h3>#(user.id)</h3>
<h3>#(user.loginName)</h3>
<h3>#date(user.createDate, "yyyy-MM-dd")</h3>
<h3>#(user.password)</h3>

<h3>后端传过来的list</h3>
<ul>
    #for(item: userList)
    <li>#(item.id)</li>
    <li>#(item.login_name)</li>
    <li>#(item.password)</li>
    <li>#(item.createDate)</li>
    #end
</ul>


<h3>后端传过来的map</h3>
<ul>
    #for(item : userMap)
    <li>#(item.key)</li>
    <li>#(item.value.login_name)</li>
    <li>#(item.value.password)</li>
    <li>#(item.value.createDate)</li>
    #end
</ul>

#include("friend.html", title="友情连接")

</body>
</html>
